const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  mode: 'development',

  entry: './app.js',

  devServer: {
    static: path.resolve(__dirname, './dist'),
    compress: false, // gzip压缩
    port: 3000, // 端口
    headers: { // 请求头
      'X-Access-Token': '123'
    },
    proxy: { // 代理
      '/api': 'http://localhost:9000'
    },
    // https: true, // 开启https服务
    http2: true, // 开启HTTP/2 服务，自带签名证书

    historyApiFallback: true, // 
  },

  output: {
    publicPath: '/',
    clean: true
  },

  plugins: [
    new HtmlWebpackPlugin()
  ]
}